/*
 * @Description: 全宗reducer
 * @Author: Rfan
 * @Date: 2022-01-08 16:30:05
 * @LastEditTime: 2022-09-29 18:36:57
 */

import {
  SET_TITLE,
  SET_CONDITION,
  SET_FIELDCONDITION,
  SET_ADDITIONALSEARCH,
  SET_LISTQUERYDATA,
  SET_CHOICE
} from '../constants';

export const SearchResultReducer = (state, action) => {
  console.log('srr', state, action);
  switch (action.type) {
    case SET_CONDITION:
      return { ...state, atConditionList: action.data };
    case SET_FIELDCONDITION:
      return { ...state, fieldConditionList: action.data };
    case SET_ADDITIONALSEARCH:
      return { ...state, additionalSearch: action.data };
    case SET_LISTQUERYDATA:
      return { ...state, listQueryData: action.data };
    case SET_CHOICE:
      return { ...state, choices: action.data };
    // 修改搜索结果页标题
    case SET_TITLE:
      return { ...state, title: action.title };

    default:
      return state;
  }
};
